package com.wavehi.login.service;

import com.wavehi.login.pojo.User;
import org.springframework.stereotype.Service;

/**
 * @Author WaveHi
 * @Date 25/10/2021 下午 7:42
 * @Version 1.0
 * @Contact HJBWaveHi@163.com
 * @Description Deal the business for user.
 */
@Service
public interface UserService {

    /**
     * Add a user.
     * @param user User information for addition.
     * @return If false is returned, user have already existed.
     */
    Boolean addUser(User user);

    /**
     * Judge whether user exists according to user name.
     * @param username User name
     * @return If true is returned, user exist.
     */
    Boolean existUser(String username);

    /**
     * Judge whether user exists according to user name and password.
     * @param username User name
     * @param password User password
     * @return If true is returned, user exists.
     */
    Boolean existUser(String username, String password);

    /**
     * Get user information according to id
     * @param id User id
     * @return Return user information.
     */
    User getUser(Long id);

    /**
     * Get user information according to user name.
     * @param username User name
     * @return Return the specified user information.
     */
    User getUser(String username);
}
